package com.asiainfo.dacp.datastash.worker.executor.adapter.datax.model.plugin;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.google.common.base.Strings;

import lombok.Data;

@Data
public class UnStructuredWriter implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 763461660131274137L;
	
	private String path;
	private String fileName;
	private String writeMode = "nonConflict";

	private String fieldDelimiter = ",";
	private String compress;
	private String encoding = "utf-8";
	private String nullFormat = "\\N";
	private String dateFormat = "yyyy-MM-dd";

	private String fileFormat = "text";
	
	private List<String> header;
	
	public void setCompress(String compress){
		if(Strings.isNullOrEmpty(compress)){
		}else{
			if(!compress.equalsIgnoreCase("none")){
				this.compress = compress.trim();
			}
		}
	}
	
	public UnStructuredWriter(){}
	public UnStructuredWriter(UnStructuredWriter source){
		BeanUtils.copyProperties(source, this);
	}
	
}
